<?php

class StatusHistoryWidget extends CWidget
{
    // {{{ *** Members ***
    /**
     * @var string Title to be displayed above timestamp detail view
     * @access public
     */
    public $title = 'Status History';
    /**
     * @var MyModel ActiveRecord instance
     */
    public $model;
    /**
     * @var string If 'small', then small template is rendered
     * @access public
     */
    public $style;
    /**
     * @var array HTML attributes for the menu's root container tag
     */
    public $htmlOptions=array();
    // }}} 
    // {{{ *** Methods ***
    // {{{ init
    public function init()
    {
	$this->htmlOptions['id']=$this->getId();

    } // }}} 
    // {{{ run
    public function run()
    {
        $criteria=new CDbCriteria;
        $criteria->condition = "tableName='".$this->model->tableSchema->name."' AND primKey=".$this->model->id;
        $criteria->order = 'statusTimestamp DESC';
        $provider = new CActiveDataProvider(StatusHistory::model(), array('criteria'=>$criteria));
        $this->render('statusHistoryWidget',array('data'=>$provider));
    } // }}} 
    // }}} End Methods
}
/* vim:set ai sw=4 sts=4 et fdm=marker fdc=4: */ 
?>
